#include<iostream>
#include<unordered_set>

using namespace std;

int canBeTypedWords(string s, string brokenLetters) {
    unordered_set<char> st;
    for (auto it : brokenLetters)   st.insert(it);
    int n = s.size();
    bool flag = true;
    int res = 0;
    for (int i = 0; i <= n; i++)
    {
        if (i == n || s[i] == ' ')
        {
            if (flag)    res++;
            flag = true;
            continue;
        }
        if (st.find(s[i]) != st.end())
            flag = false;
    }
    return res;
}